﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Admin;
namespace Xproject.Util
{
  public   class Cache_Advertisements
    {
        //前端首页轮播
        public static string CACHE_KEY_ADVERTISEMENT_QDSYLB = "CACHE_KEY_ADVERTISEMENT_QDSYLB";
        //前端首页浮动
        public static string CACHE_KEY_ADVERTISEMENT_QDSYFD = "CACHE_KEY_ADVERTISEMENT_QDSYFD";

        public static List<Advertisement> Ad_QDSYLB
        {
            get
            {
                return System.Web.HttpRuntime.Cache[CACHE_KEY_ADVERTISEMENT_QDSYLB] as List<Advertisement>;

            }
            set
            {
                System.Web.HttpRuntime.Cache.Insert(CACHE_KEY_ADVERTISEMENT_QDSYLB, value, null, DateTime.Now.AddMonths(1), System.Web.Caching.Cache.NoSlidingExpiration);
            }
        }

        public static void ClearAd_QDSYLB()
        {
            System.Web.HttpRuntime.Cache.Remove(CACHE_KEY_ADVERTISEMENT_QDSYLB);
        }
    }
}
